package com.crawler.search.index.entity;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilder;

import java.util.HashMap;
import java.util.Map;

/**
 * 查询实体
 * @author zyh
 *
 */
@Data
public class QueryParam {
	
	protected String searchType;//索引类型
    
    protected String searchIndex;//索引
    
    protected String[] highlight;//高亮字段，默认为检索的多字段
    
    protected Map<String, Float> fieldBoostMap = new HashMap<String, Float>();
    
    protected Map<String, String> filedMap = new HashMap<String, String>();//must term查询key为查询字段，value为对应的es中存储的字段，精确匹配
    
    protected Map<String, String> shouldMap = new HashMap<String, String>();//should term查询key为查询字段，value为对应的es中存储的字段

	protected Map<String, String> segMap = new HashMap<String, String>();//must multiMatchQuery，分词字段查询，非精确匹配

	protected QueryBuilder query;//查询query
    
    protected QueryBuilder rescoreQuery;//重打分
    
    protected Map<String, String> sortMap = new HashMap<String, String>();//排序字段
    
    protected Map<String, JSONObject> rangeMap = new HashMap<String, JSONObject>();//范围字段
    
    protected String search;//搜索内容
    
    protected AggregationBuilder[] aggers;//

	protected String[] distinct;//数据去重字段

	protected Map<String, String> excludeMap = new HashMap<String, String>();//排除返回字段

	protected Map<String, String> includeMap = new HashMap<String, String>();//包含字段

}
